using dbvc.context.Security;
using NUnit.Framework;

namespace tdd.dbvc
{
    public partial class tests
    {
        private readonly Security security = new Security();

        [Test] 
        public void root_login()
        {
            security.Login("root", "root");
            Assert.AreEqual(security.IsAuth(), true);
        }

        [Test]
        public void other_login()
        {
            security.Login("x", "x");
            Assert.AreEqual(security.IsAuth(), false);

            add_users();

            security.Login("X1", "X1");
            Assert.AreEqual(security.IsAuth(), true);
        }

        [Test]
        public void logout()
        {
            other_login();
            
            security.Logout();
            
            Assert.AreEqual(security.IsAuth(), false);
        }

        //[Test]
        //public void execute_action()
        //{
        //    root_login();

        //    var cnt = usr.Actions().Count;

        //    for (int i = cnt - 1; i >= 0; i--)
        //    {
        //        usr.Actions()[i]();
        //    }
        //}
    }
}